import MerchantLayout from "@/layouts/merchant.vue";

export default {
  path: "/merchant",
  component: MerchantLayout,
  meta: {
    requiresAuth: true,
    requiresMerchant: true,
  },
  children: [
    {
      path: "dashboard",
      name: "MerchantDashboard",
      component: () => import("@/views/merchant/dashboard.vue"),
      meta: {
        title: "数据概览",
        requiresAuth: true,
        roles: ["merchant"],
      },
    },
    {
      path: "orders",
      name: "MerchantOrders",
      component: () => import("@/views/merchant/orders/index.vue"),
      meta: {
        title: "订单管理",
      },
    },
    {
      path: "orders/refund",
      name: "MerchantOrderRefund",
      component: () => import("@/views/merchant/orders/refund.vue"),
      meta: {
        title: "退款管理",
      },
    },
    {
      path: "orders/delivery",
      name: "MerchantOrderDelivery",
      component: () => import("@/views/merchant/orders/delivery.vue"),
      meta: {
        title: "发货管理",
      },
    },
    {
      path: "orders/:id",
      name: "MerchantOrderDetail",
      component: () => import("@/views/merchant/orders/detail.vue"),
      meta: {
        title: "订单详情",
      },
    },
    {
      path: "products",
      name: "MerchantProducts",
      component: () => import("@/views/merchant/products/index.vue"),
      meta: {
        title: "商品管理",
      },
    },
    {
      path: "products/inventory",
      name: "MerchantProductInventory",
      component: () => import("@/views/merchant/products/inventory.vue"),
      meta: {
        title: "库存管理",
      },
    },
    {
      path: "products/create",
      name: "MerchantProductCreate",
      component: () => import("@/views/merchant/products/edit.vue"),
      meta: {
        title: "新增商品",
      },
    },
    {
      path: "products/:id/edit",
      name: "MerchantProductEdit",
      component: () => import("@/views/merchant/products/edit.vue"),
      meta: {
        title: "编辑商品",
      },
    },
    {
      path: "comments",
      name: "MerchantComments",
      component: () => import("@/views/merchant/comments/index.vue"),
      meta: {
        title: "评价管理",
        requiresAuth: true,
        roles: ["merchant"],
      },
    },
    {
      path: "comments/analysis",
      name: "MerchantCommentsAnalysis",
      component: () => import("@/views/merchant/comments/analysis.vue"),
      meta: {
        title: "评分分析",
        requiresAuth: true,
        roles: ["merchant"],
      },
    },
    {
      path: "marketing",
      name: "MerchantMarketing",
      component: () => import("@/views/merchant/marketing/index.vue"),
      meta: {
        title: "营销管理",
        requiresAuth: true,
        roles: ["merchant"],
      },
    },
    {
      path: "marketing/promotions",
      name: "MerchantPromotions",
      component: () => import("@/views/merchant/marketing/promotions.vue"),
      meta: {
        title: "促销活动",
        requiresAuth: true,
        roles: ["merchant"],
      },
    },
    {
      path: "marketing/flash-sale",
      name: "MerchantFlashSale",
      component: () => import("@/views/merchant/marketing/flash-sale.vue"),
      meta: {
        title: "限时特惠",
        requiresAuth: true,
        roles: ["merchant"],
      },
    },
    {
      path: "finance",
      name: "MerchantFinance",
      component: () => import("@/views/merchant/finance/index.vue"),
      meta: {
        title: "财务管理",
      },
    },
    {
      path: "finance/withdraw",
      name: "MerchantWithdraw",
      component: () => import("@/views/merchant/finance/withdraw.vue"),
      meta: {
        title: "提现管理",
      },
    },
    {
      path: "finance/bill",
      name: "MerchantBill",
      component: () => import("@/views/merchant/finance/bill.vue"),
      meta: {
        title: "对账单",
      },
    },
    {
      path: "settings",
      name: "MerchantSettings",
      component: () => import("@/views/merchant/settings/index.vue"),
      meta: {
        title: "商户设置",
        requiresAuth: true,
        roles: ["merchant"],
      },
      children: [
        {
          path: "",
          name: "MerchantSettingsBasic",
          component: () => import("@/views/merchant/settings/basic.vue"),
          meta: {
            title: "基本信息",
          },
        },
        {
          path: "security",
          name: "MerchantSettingsSecurity",
          component: () => import("@/views/merchant/settings/security.vue"),
          meta: {
            title: "安全设置",
          },
        },
        {
          path: "notification",
          name: "MerchantSettingsNotification",
          component: () => import("@/views/merchant/settings/notification.vue"),
          meta: {
            title: "通知设置",
          },
        },
        {
          path: "payment",
          name: "MerchantSettingsPayment",
          component: () => import("@/views/merchant/settings/payment.vue"),
          meta: {
            title: "支付设置",
          },
        },
        {
          path: "store",
          name: "MerchantSettingsStore",
          component: () => import("@/views/merchant/settings/store.vue"),
          meta: {
            title: "店铺设置",
          },
        },
      ],
    },
    {
      path: "profile",
      name: "MerchantProfile",
      component: () => import("@/views/merchant/profile/index.vue"),
      meta: {
        title: "个人信息",
        requiresAuth: true,
        roles: ["merchant"],
      },
    },
    {
      path: "profile/settings",
      name: "MerchantProfileSettings",
      component: () => import("@/views/merchant/profile/settings.vue"),
      meta: {
        title: "账号设置",
        requiresAuth: true,
        roles: ["merchant"],
      },
    },
    {
      path: "notification",
      name: "MerchantNotification",
      component: () => import("@/views/merchant/notification/index.vue"),
      meta: {
        title: "消息中心",
        icon: "fas fa-bell",
        requiresAuth: true,
        roles: ["merchant"],
      },
    },
    {
      path: "account/profile",
      name: "MerchantAccountProfile",
      component: () => import("@/views/merchant/account/profile.vue"),
      meta: {
        title: "个人信息",
        requiresAuth: true,
        roles: ["merchant"],
      },
    },
    {
      path: "account/settings",
      name: "MerchantAccountSettings",
      component: () => import("@/views/merchant/account/settings.vue"),
      meta: {
        title: "账号设置",
        requiresAuth: true,
        roles: ["merchant"],
      },
    },
  ],
};
